{% extends "base.html" %}
{% block ext_title %}
    <title>作者信息修改</title>
{% endblock %}
{% block content %}
    <div class="content-wrapper">
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-12">
                        <ol class="breadcrumb float-sm-left">
                            <li class="breadcrumb-item"><a href="{{url_for('author_list')}}">作者管理</a></li>
                            <li class="breadcrumb-item active">作者修改</li>
                        </ol>
                    </div>
                </div>
            </div>
        </section>
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <!-- left column -->
                    <div class="col-md-12">
                        <!-- Horizontal Form -->
                        <div class="card card-info">
                            <div class="card-header">
                                <h3 class="card-title">作者信息修改</h3>
                            </div>
                            <!-- /.card-header -->
                            <!-- form start -->
                            <form class="form-horizontal" method="post" novalidate>
                                {{ form.csrf_token }}
                                <div class="card-body">
                                    <div class="form-group row">
                                        <label for="inputtext" class="col-sm-2 col-form-label">作者姓名</label>

                                        <div class="col-sm-10">
{#                                            <input type="text" class="form-control" id="name" name="name"#}
{#                                                   value="{{ form.name }}" placeholder="作者姓名">#}
                                            {{ form.name }}
                                            <span style="color:red">{{ form.name.errors[0] }}</span>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="inputtext" class="col-sm-2 col-form-label">年龄</label>
                                        <div class="col-sm-10">
{#                                            <input type="number" class="form-control" id="age" name="age"#}
{#                                                   placeholder="请输入年龄" value="{{ form.age }}">#}
                                            {{ form.age }}
                                            <span style="color:red">{{ form.age.errors[0] }}</span>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="inputtext" class="col-sm-2 col-form-label">电话</label>
                                        <div class="col-sm-10">
{#                                            <input type="number" minlength="11" maxlength="11" class="form-control"#}
{#                                                   id="mobile" name="mobile" value="{{ form.mobile }}"#}
{#                                                   placeholder="电话">#}
                                            {{ form.mobile }}
                                            <span style="color:red">{{ form.mobile.errors[0] }}</span>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="inputtext" class="col-sm-2 col-form-label">地址</label>
                                        <div class="col-sm-10">
{#                                            <input type="text" class="form-control" id="address" name="address"#}
{#                                                   value="{{ form.address }}" placeholder="地址">#}
                                            {{ form.address }}
                                            <span style="color:red">{{ form.address.errors[0] }}</span>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label for="inputtext" class="col-sm-2 col-form-label">简介</label>
                                        <div class="col-sm-10">
{#                                            <textarea class="form-control" rows="3" id="intro" name="intro"#}
{#                                                      placeholder="简介">{{ form.intro }}</textarea>#}
                                            {{ form.intro }}
                                        </div>
                                    </div>
                                </div>
                                <!-- /.card-body -->
                                <div class="card-footer">
                                    <button type="submit" class="btn btn-info">保存</button>
                                    <script>    var authorListUrl = "{{ url_for('author_list') }}";
                                    </script>
                                    <button type="button" class="btn btn-default"
                                            onclick="javascript:window.location=authorListUrl">返回
                                    </button>
                                    <span style="color:red">{{ info }}</span>
                                </div>
                                <!-- /.card-footer -->
                            </form>
                        </div>
                        <!-- /.card -->
                    </div>

                    <!--/.col (right) -->
                </div>
                <!-- /.row -->
            </div><!-- /.container-fluid -->
        </section>
    </div>
{% endblock %}